GDB (GNU Debugger)

  • GDB .

  • docs .

  • download .

  • GDB Showcase

  • Not possible if compiling with MSVC:

    • GDB is designed around:

      • DWARF debug info

      • ELF/Mach-O style binaries

    • MSVC produces:

      • PDB debug symbols

      • COFF/PE binaries on Windows

    • So the core debug formats are incompatible.

    • Technically attachable, practically not useful.

Installation
  • With MSYS2:

    • MINGW64: pacman -S mingw-w64-x86_64-gdb

    • UCRT64: pacman -S mingw-w64-ucrt-x86_64-gdb

    • CLANG64: pacman -S mingw-w64-clang-x86_64-gdb

      • At C:\msys64\clang64\bin\

      • I opted for this one.

Can read
  • DWARF

Languages
  • Ada

  • Assembly

  • C

  • C++

  • D

  • Fortran

  • Go

  • Objective-C

  • OpenCL

  • Modula-2

  • Pascal

  • Rust

Platforms
  • Linux:
    Full support

  • Windows:
    Partial support (via MinGW, Cygwin, WSL)

  • macOS:
    Partial support (requires manual code signing)

  • BSDs (FreeBSD, OpenBSD, NetBSD):
    Full support

  • Embedded Systems:
    Full support (via GDB stubs/OpenOCD)

  • Legacy Unix (e.g., Solaris, AIX):
    Limited/legacy support

Pros
  • Low-level control; scripting support; remote debugging

Cons
  • Steeper learning curve; less intuitive than GUI

GUI Front-ends